package com.syni.mdd.sjb.common.datatreaure.service.impl;

import com.syni.mdd.sjb.common.component.mybatis.dxshapp.entity.BmsUserBusiness;
import com.syni.mdd.sjb.common.component.utils.common.utils.RpcResponseVo;
import com.syni.mdd.sjb.common.component.utils.feign.service.mdd.commonuser.UserBusinessRestService;
import com.syni.mdd.sjb.common.datatreaure.service.BmsUserBusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 店员表 服务实现类
 * </p>
 *
 * @author lcc
 * @since 2020-06-08
 */
@Service
public class BmsUserBusinessServiceImpl  implements BmsUserBusinessService {

    @Autowired
    UserBusinessRestService userBusinessRestService;


    @Override
    public List<BmsUserBusiness> getBmsUserBusinessList(Integer userId) {
        RpcResponseVo rpcResponseVo = userBusinessRestService.getBusinessUserByUserId(userId);
        if(rpcResponseVo.isSuccess()){
            List<BmsUserBusiness> bmsUserBusinesses = rpcResponseVo.parseArray(BmsUserBusiness.class);
            return bmsUserBusinesses;
        }
        return null;
    }
}
